package utils;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class StreamConvertTool {
	public static byte[] InputStreamToByteArray(InputStream in){
		byte[] buff = new byte[1024000];
		int len = 0;
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		try {
			while((len=in.read(buff))!=-1){
				bos.write(buff,0,len);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return bos.toByteArray();
	}
//	public static 
}
